export default {
  inserted(el, binding, vnode) {
    let hasPermission
    const { value: [code, arr], value } = binding
    if (value && Array.isArray(value) && value.length > 0) {
      const temp = arr.find(item => code === item.funCode)
      if (temp) {
        hasPermission = true
        el.lastChild.textContent = temp.funName
      }
      if (!hasPermission) {
        el.parentNode && el.parentNode.removeChild(el)
      }
    }
  }
}
